/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lesson3.com.demo.lang;


public class EqualsObject {

   private int x;
   protected String s;
   Double d;

    @Override
    public int hashCode() {
      /*  int hash = 7;
        hash = 67 * hash + this.x;
        hash = 67 * hash + (this.s != null ? this.s.hashCode() : 0);
        hash = 67 * hash + (this.d != null ? this.d.hashCode() : 0);
        return hash;
        * */
        int hash = new Integer(x).hashCode();
        if(s!=null){
            hash ^= s.hashCode();
        }
        if(d!=null){
            hash ^= d.hashCode();
        }
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final EqualsObject other = (EqualsObject) obj;
        if (this.x != other.x) {
            return false;
        }
        if ((this.s == null) ? (other.s != null) : !this.s.equals(other.s)) {
            return false;
        }
        if (this.d != other.d && (this.d == null || !this.d.equals(other.d))) {
            return false;
        }
        return true;
    }
   
   
    
    

}
